package com.joinway.framework.text.sql.bean;

import java.util.ArrayList;
import java.util.List;

import com.joinway.framework.bean.BaseBean;

public class Table extends BaseBean {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private String name;
	private List<Column> columns;
	
	public List<Column> getPrimaryColumns(){
		List<Column> list = new ArrayList<>();
		
		if(columns != null && columns.size() > 0){
			for(Column it : columns){
				if(it.isPrimary()){
					list.add(it);
				}
			}
		}
		
		return list;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<Column> getColumns() {
		return columns;
	}

	public void setColumns(List<Column> columns) {
		this.columns = columns;
	}
}
